function NN=plot_any_gedian(data,m1,logFlag)
beaming=2;
global ge
if(logFlag)
    data(:,m1)=log10(data(:,m1));
end
maxm1=max(data(:,m1));
minm1=min(data(:,m1));
XX=linspace(minm1,maxm1,ge);
Xjian=(maxm1-minm1)./(ge-1);
NN=XX.*0;
[len,~]=size(data);
for i= 1:len
    wei=ceil((data(i,m1)-minm1)./Xjian)+1;
    if(wei<1)
        fprintf('WARNING: plot_any_gedian.m      wei<1    b>1')
        continue
    end

%     deal with wei which is out of range coz the wrong chosen number of
%     maxLx
    if(wei>length(NN))
%         log10(data(i,3))
        wei=length(NN);
%          fprintf('WARNING: plot_any_gedian.m   wei>length   ')
        continue;
    end
    
    if(data(i,15)>100)
   NN(wei)=NN(wei)+data(i,20)...
        *massFunction(data(i,1)).*Beamingfactor(beaming,data(i,17));
    else
        NN(wei)=NN(wei)+...
            data(i,20)*massFunction(data(i,1));
    end
end
% NNsum=cumsum(NN,'reverse');

% plot(Lx_x,log10(NN))

% after cumsum of NN. (more smooth [\doge] )
bar(XX,log10(NN))
if(logFlag)
xlabel('log10(X)');
else
    xlabel('(X)');
end
ylabel('log10(N)');

end